package cn.tedu.sp04.order.feignclient;

import org.springframework.stereotype.Component;

import cn.tedu.sp01.pojo.User;
import cn.tedu.web.util.JsonResult;

@Component
public class UserClientFB implements UserClient {

    @Override
    public JsonResult<User> getUser(Integer userId) {
        if(Math.random()<0.5) {
            return JsonResult.ok().data(new User(8,null,null));
        }
        return JsonResult.err("获取用户服务失败");
    }

    @Override
    public JsonResult addScore(Integer userId, Integer score) {
        return JsonResult.err().msg("获取用户服务失败");
    }

}
